package com.ywh.composetest.activity

import android.os.Bundle
import androidx.activity.ComponentActivity
import androidx.activity.compose.setContent
import androidx.compose.foundation.layout.fillMaxSize
import androidx.compose.material3.Scaffold
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.core.view.WindowCompat
import com.ywh.composetest.ui.theme.ComposeTestTheme

abstract class BaseComposeActivity : ComponentActivity() {
    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
//        //内容延伸到状态栏
//        WindowCompat.setDecorFitsSystemWindows(window, false)

        setContent {
            ComposeTestTheme {
                // A surface container using the 'background' color from the theme
                Scaffold(
                    modifier = Modifier.fillMaxSize()
                ) { p ->
                    OnComposable(savedInstanceState)
                }
            }
        }
    }

    @Composable
    abstract fun OnComposable(savedInstanceState: Bundle?)
}